/**
 * @Author: Boring
 * @Description:
 * @File:  configmap
 * @Date: 2024-03-02 14:50
 */

package configmap

import (
	"github.com/gin-gonic/gin"
	"oam-manage-backend/controllers/configmap"
)

func create(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/create", configmap.Create)
}

func update(configmapGroup *gin.RouterGroup) {
	configmapGroup.PUT("/update", configmap.Update)
}

func delete(configmapGroup *gin.RouterGroup) {
	configmapGroup.DELETE("/delete", configmap.Delete)
}

func deleteList(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/deleteList", configmap.DeleteList)
}

func get(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/get", configmap.Get)
}

func list(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/list", configmap.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	configmapGroup := g.Group("/configmap")
	create(configmapGroup)
	update(configmapGroup)
	delete(configmapGroup)
	deleteList(configmapGroup)
	get(configmapGroup)
	list(configmapGroup)
}
